public class Arrays {
	public static void main(String[] args) {
		int n = 50;
		
		for (int i = 1; i <= n; i++) {
			System.out.println(i);
		}
		
		for (int i = 1; i < n; i++) {
			if (i % 3 == 0) {
				System.out.println(String.format("Number %s is divisible by 3", i));
			}
		}

		int[] array = new int[50];		
		for (int i = 0; i < n; i++) {
			array[i] = i + 1;			
		}
		System.out.println(avg(array));
	}
	
	private static double avg(int[] array) {
		if (array.length == 0) {
			return 0;
		}
		int sum = 0;
		for (int i = 0; i < array.length; i++) {
			sum += array[i];
		}
		double avg = ((double)sum) / array.length;
		return avg;
	}
}